package gui;

import java.awt.Color;
import java.awt.Dimension;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.border.LineBorder;

public class LineageFrame extends JFrame {

	private int[] lineage;
	
	private JPanel containerPanel;
	private JTextArea lineageText;
	
	private final Color bkg = new Color(255,99,71);
	
	public LineageFrame(int[] lin){
		lineage = lin;
		
		setSize(200, 500);
		setTitle("View selected critter's lineage");
		containerPanel = new JPanel();
		containerPanel.setBorder(new LineBorder(bkg, 3));
		add(containerPanel);
		
		StringBuffer sb = new StringBuffer();
		for(int i : lineage)
			sb.insert(0, i + "\n");
		lineageText = new JTextArea(sb.toString()){
			public Dimension getMinimumSize(){
				return new Dimension(100, 400);
			}
		};
		lineageText.setEditable(false);
		containerPanel.add(lineageText);
		
		containerPanel.setBackground(bkg);
		lineageText.setBackground(bkg);
		setVisible(true);
	}
}
